<template>
  <div class="outer">
    <h1>Movie</h1>
    <h3>电影列表 <button @click="getMovieList">获取电影列表</button></h3>
    <ul>
      <li v-for="movie in movieList" :key="movie.tvId">{{ movie.name }}</li>
    </ul>
    <h3>我的电影列表</h3>
    <ul>
      <li v-for="movie in myMovieList" :key="movie.tvId">{{ movie.name }}</li>
    </ul>
    <h3>俺的电影列表</h3>
    <ul>
      <li v-for="movie in yourMovieList" :key="movie.tvId">{{ movie.name }}</li>
    </ul>
  </div>
</template>

<script>
import { mapActions, mapGetters, mapState } from "vuex";
export default {
  name: "Movie",
  computed: {
    ...mapState("movie", ["movieList"]),
    ...mapGetters("movie", ["myMovieList"]),
    yourMovieList() {
      return this.$store.getters["movie/yourMovieList"]({ start: 2, end: 3 });
    },
  },
  methods: {
    ...mapActions("movie", ["getMovieList"]),
  },
};
</script>

<style scoped>
.outer {
  min-height: 100%;
  background-image: linear-gradient(110deg, #3cf, rgb(177, 246, 255));
  border-radius: 20px;
  border: 3px solid rgb(0, 0, 0);
}
</style>